package org.xin.framework.tree;

/**
 * @author ：xin
 * @date ：Created in 2021/10/9
 * @desc <p>  </p>
 * @modified By：$
 * @version: $
 */
@FunctionalInterface
public interface TreePredicate<T, R> {
    boolean test(T t, R r);

    static <T extends ITreeNode, R> TreePredicate<T, R> rootNodePredicate() {
        return (T t, R r) -> t.parentId() == null || t.parentId().equals(r);
    }
}
